using UnityEngine;
using UnityEngine.SceneManagement;


namespace Brick
{
	public class LevelManager : MonoBehaviour
	{
		public void LoadLevel(string name)
		{
			Bricks.breakableCount = 0;
			SceneManager.LoadScene(name);
		}

		public void QuitRequest()
		{
			Application.Quit();
		}

		public void LoadNextLevel()
		{
			Bricks.breakableCount = 0;
			SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
		}

		public void BrickDestroyed()
		{
			if (Bricks.breakableCount <= 0)
			{
				LoadNextLevel();
			}
		}
	}
}

